//    Copyright (C) 2013  <lugocreation@gmail.com>
//
//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>
package org.jpgolay.wi.salesperson;

import java.io.Serializable;
import java.math.BigDecimal;

public class SalesPerson
        implements Serializable {

    public SalesPerson() {
    }

    public SalesPerson(Integer id, String firstname, String area, String resultsDate, BigDecimal objectif, String objectifDate, String tel,
            String cel, String fax, BigDecimal salesRate, BigDecimal totalSalesRate, String notes, String email, String level,
            BigDecimal results, String lastname, String updateLastTime, String lastUserId, String addrLn1, String addrLn2, String zip,
            String city, String country, String salesPersonFamily) {
        setId(id);
        setFirstname(firstname);
        setArea(area);
        setResultsDate(resultsDate);
        setObjectif(objectif);
        setObjectifDate(objectifDate);
        setTel(tel);
        setCel(cel);
        setFax(fax);
        setSalesRate(salesRate);
        setTotalSalesRate(totalSalesRate);
        setNotes(notes);
        setEmail(email);
        setLevel(level);
        setResults(results);
        setLastname(lastname);
        setLastTime(updateLastTime);
        setLastUserId(lastUserId);
        setSalesPersonFamily(salesPersonFamily);
        setAddrLn1(addrLn1);
        setAddrLn2(addrLn2);
        setZip(zip);
        setCity(city);
        setCountry(country);
    }

    public SalesPerson(SalesPerson salesPerson) {
        setId(salesPerson.getId());
        setFirstname(salesPerson.getFirstname());
        setArea(salesPerson.getArea());
        setResultsDate(salesPerson.getResultsDate());
        setObjectif(salesPerson.getObjectif());
        setObjectifDate(salesPerson.getObjectifDate());
        setTel(salesPerson.getTel());
        setCel(salesPerson.getCel());
        setFax(salesPerson.getFax());
        setSalesRate(salesPerson.getSalesRate());
        setTotalSalesRate(salesPerson.getTotalSalesRate());
        setNotes(salesPerson.getNotes());
        setEmail(salesPerson.getEmail());
        setLevel(salesPerson.getLevel());
        setResults(salesPerson.getResults());
        setLastname(salesPerson.getLastname());
        setLastTime(salesPerson.getLastTime());
        setLastUserId(salesPerson.getLastUserId());
        setSalesPersonFamily(salesPerson.getSalesPersonFamily());
        setAddrLn1(salesPerson.getAddrLn1());
        setAddrLn2(salesPerson.getAddrLn2());
        setZip(salesPerson.getZip());
        setCity(salesPerson.getCity());
        setCountry(salesPerson.getCountry());
    }

    public Integer getId() {
        return id;
    }

    public String getFirstname() {
        return firstname;
    }

    public String getArea() {
        return area;
    }

    public String getTel() {
        return tel;
    }

    public String getCel() {
        return cel;
    }

    public String getFax() {
        return fax;
    }

    public BigDecimal getSalesRate() {
        return salesRate;
    }

    public BigDecimal getTotalSalesRate() {
        return totalSalesRate;
    }

    public String getNotes() {
        return notes;
    }

    public String getEmail() {
        return email;
    }

    public String getLevel() {
        return level;
    }

    public String getLastname() {
        return lastname;
    }

    public BigDecimal getResults() {
        return results;
    }

    public String getLastTime() {
        return lastTime;
    }

    public String getLastUserId() {
        return lastUserId;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public void setLastUserId(String lastUserId) {
        this.lastUserId = lastUserId;
    }

    public void setFirstname(String firstname) {
        this.firstname = firstname;
    }

    public void setArea(String area) {
        this.area = area;
    }

    public void setTel(String tel) {
        this.tel = tel;
    }

    public void setCel(String cel) {
        this.cel = cel;
    }

    public void setFax(String fax) {
        this.fax = fax;
    }

    public void setSalesRate(BigDecimal salesRate) {
        this.salesRate = salesRate;
    }

    public void setTotalSalesRate(BigDecimal totalSalesRate) {
        this.totalSalesRate = totalSalesRate;
    }

    public void setNotes(String notes) {
        this.notes = notes;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public void setLevel(String level) {
        this.level = level;
    }

    public void setLastname(String lastname) {
        this.lastname = lastname;
    }

    public void setResults(BigDecimal results) {
        this.results = results;
    }

    public void setLastTime(String lastTime) {
        this.lastTime = lastTime;
    }

    public String getObjectifDate() {
        return objectifDate;
    }

    public BigDecimal getObjectif() {
        return objectif;
    }

    public String getResultsDate() {
        return resultsDate;
    }

    public void setObjectifDate(String objectifDate) {
        this.objectifDate = objectifDate;
    }

    public void setObjectif(BigDecimal objectif) {
        this.objectif = objectif;
    }

    public void setResultsDate(String resultsDate) {
        this.resultsDate = resultsDate;
    }

    public String getSalesPersonFamily() {
        return salesPersonFamily;
    }

    public void setSalesPersonFamily(String salesPersonFamily) {
        this.salesPersonFamily = salesPersonFamily;
    }

    public String getAddrLn1() {
        return addrLn1;
    }

    public void setAddrLn1(String addrLn1) {
        this.addrLn1 = addrLn1;
    }

    public String getAddrLn2() {
        return addrLn2;
    }

    public void setAddrLn2(String addrLn2) {
        this.addrLn2 = addrLn2;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public String getZip() {
        return zip;
    }

    public void setZip(String zip) {
        this.zip = zip;
    }

    public String toString() {
        StringBuffer str = new StringBuffer("{");
        str.append("id=" + getId() + " " + "firstname=" + getFirstname() + " " + "area=" + getArea() + " " + "resultsDate=" + getResultsDate() + " " + "objectif=" + getObjectif() + " " + "objectifDate=" + getObjectifDate() + " " + "tel=" + getTel() + " " + "cel=" + getCel() + " " + "fax=" + getFax() + " " + "salesRate=" + getSalesRate() + " " + "totalSalesRate=" + getTotalSalesRate() + " " + "notes=" + getNotes() + " " + "email=" + getEmail() + " " + "level=" + getLevel() + " " + "results=" + getResults() + " " + "lastname=" + getLastname() + " " + "addrLn1=" + getAddrLn1() + " " + "addrLn2=" + getAddrLn2() + " " + "zip=" + getZip() + " " + "city=" + getCity() + " " + "country=" + getCountry() + " " + "lastTime=" + getLastTime() + " " + "salesPersonFamily=" + getSalesPersonFamily() + " " + "lastUserId=" + getLastUserId());
        str.append('}');
        return str.toString();
    }

    public boolean equals(Object pOther) {
        if (pOther instanceof SalesPerson) {
            SalesPerson lTest = (SalesPerson) pOther;
            boolean lEquals = true;
            if (id == null) {
                lEquals = lEquals && lTest.id == null;
            } else {
                lEquals = lEquals && id.equals(lTest.id);
            }
            if (firstname == null) {
                lEquals = lEquals && lTest.firstname == null;
            } else {
                lEquals = lEquals && firstname.equals(lTest.firstname);
            }
            if (area == null) {
                lEquals = lEquals && lTest.area == null;
            } else {
                lEquals = lEquals && area.equals(lTest.area);
            }
            if (resultsDate == null) {
                lEquals = lEquals && lTest.resultsDate == null;
            } else {
                lEquals = lEquals && resultsDate.equals(lTest.resultsDate);
            }
            if (tel == null) {
                lEquals = lEquals && lTest.tel == null;
            } else {
                lEquals = lEquals && tel.equals(lTest.tel);
            }
            if (cel == null) {
                lEquals = lEquals && lTest.cel == null;
            } else {
                lEquals = lEquals && cel.equals(lTest.cel);
            }
            if (fax == null) {
                lEquals = lEquals && lTest.fax == null;
            } else {
                lEquals = lEquals && fax.equals(lTest.fax);
            }
            if (salesRate == null) {
                lEquals = lEquals && lTest.salesRate == null;
            } else {
                lEquals = lEquals && salesRate.equals(lTest.salesRate);
            }
            if (totalSalesRate == null) {
                lEquals = lEquals && lTest.totalSalesRate == null;
            } else {
                lEquals = lEquals && totalSalesRate.equals(lTest.totalSalesRate);
            }
            if (notes == null) {
                lEquals = lEquals && lTest.notes == null;
            } else {
                lEquals = lEquals && notes.equals(lTest.notes);
            }
            if (email == null) {
                lEquals = lEquals && lTest.email == null;
            } else {
                lEquals = lEquals && email.equals(lTest.email);
            }
            if (level == null) {
                lEquals = lEquals && lTest.level == null;
            } else {
                lEquals = lEquals && level.equals(lTest.level);
            }
            if (results == null) {
                lEquals = lEquals && lTest.results == null;
            } else {
                lEquals = lEquals && results.equals(lTest.results);
            }
            if (lastname == null) {
                lEquals = lEquals && lTest.lastname == null;
            } else {
                lEquals = lEquals && lastname.equals(lTest.lastname);
            }
            if (lastTime == null) {
                lEquals = lEquals && lTest.lastTime == null;
            } else {
                lEquals = lEquals && lastTime.equals(lTest.lastTime);
            }
            if (lastUserId == null) {
                lEquals = lEquals && lTest.lastUserId == null;
            } else {
                lEquals = lEquals && lastUserId.equals(lTest.lastUserId);
            }
            if (objectif == null) {
                lEquals = lEquals && lTest.objectif == null;
            } else {
                lEquals = lEquals && objectif.equals(lTest.objectif);
            }
            if (objectifDate == null) {
                lEquals = lEquals && lTest.objectifDate == null;
            } else {
                lEquals = lEquals && objectifDate.equals(lTest.objectifDate);
            }
            if (salesPersonFamily == null) {
                lEquals = lEquals && lTest.salesPersonFamily == null;
            } else {
                lEquals = lEquals && salesPersonFamily.equals(lTest.salesPersonFamily);
            }
            if (addrLn1 == null) {
                lEquals = lEquals && lTest.addrLn1 == null;
            } else {
                lEquals = lEquals && addrLn1.equals(lTest.addrLn1);
            }
            if (addrLn2 == null) {
                lEquals = lEquals && lTest.addrLn2 == null;
            } else {
                lEquals = lEquals && addrLn2.equals(lTest.addrLn2);
            }
            if (zip == null) {
                lEquals = lEquals && lTest.zip == null;
            } else {
                lEquals = lEquals && zip.equals(lTest.zip);
            }
            if (city == null) {
                lEquals = lEquals && lTest.city == null;
            } else {
                lEquals = lEquals && city.equals(lTest.city);
            }
            if (country == null) {
                lEquals = lEquals && lTest.country == null;
            } else {
                lEquals = lEquals && country.equals(lTest.country);
            }
            return lEquals;
        } else {
            return false;
        }
    }

    public int hashCode() {
        int result = 17;
        result = 37 * result + (id == null ? 0 : id.hashCode());
        result = 37 * result + (firstname == null ? 0 : firstname.hashCode());
        result = 37 * result + (area == null ? 0 : area.hashCode());
        result = 37 * result + (resultsDate == null ? 0 : resultsDate.hashCode());
        result = 37 * result + (tel == null ? 0 : tel.hashCode());
        result = 37 * result + (cel == null ? 0 : cel.hashCode());
        result = 37 * result + (fax == null ? 0 : fax.hashCode());
        result = 37 * result + (salesRate == null ? 0 : salesRate.hashCode());
        result = 37 * result + (totalSalesRate == null ? 0 : totalSalesRate.hashCode());
        result = 37 * result + (notes == null ? 0 : notes.hashCode());
        result = 37 * result + (email == null ? 0 : email.hashCode());
        result = 37 * result + (level == null ? 0 : level.hashCode());
        result = 37 * result + (results == null ? 0 : results.hashCode());
        result = 37 * result + (lastname == null ? 0 : lastname.hashCode());
        result = 37 * result + (lastTime == null ? 0 : lastTime.hashCode());
        result = 37 * result + (lastUserId == null ? 0 : lastUserId.hashCode());
        result = 37 * result + (objectif == null ? 0 : objectif.hashCode());
        result = 37 * result + (objectifDate == null ? 0 : objectifDate.hashCode());
        result = 37 * result + (salesPersonFamily == null ? 0 : salesPersonFamily.hashCode());
        result = 37 * result + (addrLn1 == null ? 0 : addrLn1.hashCode());
        result = 37 * result + (addrLn2 == null ? 0 : addrLn2.hashCode());
        result = 37 * result + (zip == null ? 0 : zip.hashCode());
        result = 37 * result + (city == null ? 0 : city.hashCode());
        result = 37 * result + (country == null ? 0 : country.hashCode());
        return result;
    }
    private Integer id;
    private String lastname;
    private String firstname;
    private String area;
    private String tel;
    private String cel;
    private String fax;
    private String email;
    private String level;
    private BigDecimal salesRate;
    private BigDecimal totalSalesRate;
    private BigDecimal results;
    private String resultsDate;
    private BigDecimal objectif;
    private String objectifDate;
    private String notes;
    private String lastTime;
    private String lastUserId;
    private String salesPersonFamily;
    private String addrLn1;
    private String addrLn2;
    private String zip;
    private String city;
    private String country;
}
